package nacc

abstract class FuncionarioAbstract {
	
	String codigo
	String nomeCompleto
	String nomeCurto
	String cpf
	String telefone1
	String telefone2
	String email
	String endereco
	String bairro
	String complemento
	String cidade
	String referencia
	String cep
	Date dataDeAdmissao
	Date dataDeAfastamento
	String turno
	double percentualDaComissao
	String observacoes
	
    static constraints = {
		codigo(nullable: false, blank:false)
		nomeCompleto(nullable: false, blank:false)
		nomeCurto(nullable: false, blank:false)
		cpf(nullable: false, blank:false, cpf:[formatted:true])
		telefone1(nullable: false, blank:false, matches:"^(\\(\\d{2,3}\\)|\\d{2,3})([-\\s]?\\d{4}){2}")
		telefone2(nullable: true, blank:true, matches:"^(\\(\\d{2,3}\\)|\\d{2,3})([-\\s]?\\d{4}){2}")
		email(nullable: true, blank:true, email:true)
		endereco(nullable: false, blank:false)
		bairro(nullable: false, blank:false)
		complemento(nullable: false, blank:false)
		cidade(nullable: false, blank:false)
		referencia(nullable: true, blank:true)
		cep(nullable: false, blank:false)
		dataDeAdmissao(nullable: false, blank:false)
		dataDeAfastamento(nullable: true, blank:true)
		turno(nullable: false, blank:false, inList:["Manha","Tarde"])
		percentualDaComissao(nullable: false, blank:false)
		observacoes(nullable: true, blank:true)
    }
	public String toString() {
		"${nomeCompleto}"
	}
}
